<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
      {% if settings.extra_styles %}
        {% for style in settings.extra_styles %}
          <link rel="stylesheet" type="text/css" href="{{ style|escape }}"/>
        {% endfor %}
      {% else %}
        <link rel="stylesheet" type="text/css" href="/gae-wiki-static/style.css"/>
      {% endif %}
        <!--[if gte IE 6]>
      {% if settings.extra_ie_styles %}
        {% for style in settings.extra_ie_styles %}
          <link rel="stylesheet" type="text/css" href="{{ style|escape }}"/>
        {% endfor %}
      {% else %}
        <link rel="stylesheet" type="text/css" href="/gae-wiki-static/ie.css"/>
      {% endif %}
        <![endif]-->
      <link rel="shortcut icon" href="{% if settings.favicon %}{{ settings.favicon|escape }}{% else %}/gae-wiki-static/favicon.ico{% endif %}" type="image/png" /> 
      <link rel="alternate" type="application/rss+xml" title="New Pages" href="/w/index.rss" /> 
      {% block heads %}{% endblock %}
      <title>{% block title %}{{ settings.wiki_title|escape }}{% endblock %}</title>
      {% if settings.owner_meta %}
        <meta name="google-site-verification" content="{{ settings.owner_meta }}"/>
      {% endif %}
      {% if settings.gaid %}<script type="text/javascript">var _gaq = _gaq || []; _gaq.push(['_setAccount', '{{ settings.gaid }}']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();</script>{% endif %}
      {% for script in settings.extra_scripts %}
        <script type="text/javascript" src="{{ script|escape }}"></script>
      {% endfor %}
      {% if settings.extra_init_script %}
        <script type="text/javascript">{{ settings.extra_init_script }}</script>
      {% endif %}
    </head>
    <body>
    	{% block header %}
      <div id="header">
        <div class="top">
          <div class="login">
            {% if user %}
              <strong><a href="/w/profile">{{ user.get_nickname|escape }}</a></strong>
              <a href="/w/index">Index</a>
              <a href="/w/changes">Changes</a>
              {% if is_admin %}
                <a href="/w/users">Users</a>
              {% endif %}
                <a href="{{ log_out_url|escape }}">Sign out</a>
            {% else %}
              <div align="right"><a href="{{ log_in_url|escape }}">Log in</a></div>
            {% endif %}
          </div>
        </div>
      </div>
    	{% endblock %}
    {% if sidebar %}
      <div id="sidebar">
        {{ sidebar|wikify|safe }}
        {% if page.is_saved %}
          <div class="tools">
            <h3>Tools</h3>
            <ul>
              <li><a href="/w/backlinks?page={{ page.title|uurlencode }}">Pages that link here</a></li>
            </ul>
          </div>
        {% endif %}
      </div>
    {% endif %}
    <div id="page">
      {% block content %}{% endblock %}
    </div>
		{% block footer %}
      <div id="footer">
        {% if page.is_saved %}
        <p id="pm">This {% if revision %}revision was added{% else %}page was last edited{% endif %} {% if page.author.get_nickname %}by <a href="/user%3A{{ page.author.get_nickname|uurlencode }}">{{ page.author.get_nickname|escape }}</a>{% else %}anonymously{% endif %} on {{ page.updated|timezone|date:"Y/m/d H:i:s" }}.</p>
        {% endif %}
        {% if footer %}{{ footer|wikify|safe }}{% endif %}
      </div>
		{% endblock %}
    </body>
</html>
